const { DataTypes } = require('sequelize');

module.exports = function Floorplan(sequelize, namespace = '') {
	sequelize.define('FloorplanMergeImage', {
		id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			autoIncrement: true,
			primaryKey: true
		},
		fpid: {
			type: DataTypes.CHAR(32),
			allowNull: false
		},
		type: {
			type: DataTypes.STRING
		},
		url: {
			type: DataTypes.STRING
		},
		width: {
			type: DataTypes.INTEGER
		},
		height: {
			type: DataTypes.INTEGER
		},
		containLevels: {
			type: DataTypes.STRING
		},
		mergeMode: {
			type: DataTypes.INTEGER
		},
		createdAt: {
			type: DataTypes.DATE
		},
		updatedAt: {
			type: DataTypes.DATE
		},
		deletedAt: {
			type: DataTypes.DATE
		}
	}, {
		indexes: [{
			name: 'idx_fpid',
			fields: ['fpid']
		}],
		tableName: `${namespace}floorplan_merge_image`
	});
};